/**
 * Created with IntelliJ IDEA.
 * Description:
 * Date: 2024-01-16
 * Time:17:09
 */
public class Shape {
    public Shape shape;

    public void draw() {
        System.out.println("画一个图形");
    }

    public static void main1(String[] args) {
        String[] array = {"Triangle","Circle","Circle","Flower"};
        for(String shape:array) {
            if(shape.equals("Triangle")) {
                System.out.println("△");
            } else if(shape.equals("Circle"))  {
                System.out.println("○");
            } else if (shape.equals("Flower")) {
                System.out.println("❀");
            }
        }
    }

    public static void main(String[] args) {
        Shape[] array = {new Triangle(),new Circle(),new Circle(),new Flower()};
        for(Shape shape:array) {
            shape.draw();
        }
    }
}
